// Learn cc.Class:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
let panelBase = require("panelBase")
let viewConfig = {
    btn_back:{
        node:null,
        name:"btn_back",
        eventType:"click",
        cb:"onBtnBackClick"
    },
    fhCount:{
        node:null,
        name:"title_long/fhCount",
    },
    btn_make:{
        node:null,
        name:"make/btn_make",
        eventType:"click",
        cb:"onBtnMakeClick"
    },
    bottom:{
        node:null,
        name:"bottom"
    },
}
cc.Class({
    extends: panelBase,
    properties:{
        itemList:{
            default:[],
            type:cc.Node,
        }
    },
    init(){
        this._super(viewConfig);
        let bottom = viewConfig["bottom"].node;
        for(let i = 0 ; i < bottom.childrenCount;++i)
        {
            let child = bottom[i];
            if(child && child.indexOf("item") > -1)
            {
                this.itemList.push(child);
            }
        }
        this.isInited = true;
        this.onHide();
    },

    onBtnBackClick(){
        this.onHide();
    },

    onBtnMakeClick(){
        cc.tg.gameLogic.toblend(cc.tg.cakeRoom.cakeList[cc.tg.cakeRoom.cakeList.length-1].itemCode);
    },


    
});
